// 出库管理
import request from "@/api/request";

// 分页查询出库单
export const search_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/selectAll",
    method: "post",
    data: params,
  });
};

//   新增器材出库单
export const add_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/insert",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   出库人员列表
export const person_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/userList/"+params,
    method: "post",
  });
};

//   出库部门列表
export const door_ck = () => {
  return request({
    url: "/equipmentmanage/er/orgList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   仓库列表
export const ck_ck = () => {
  return request({
    url: "/equipmentmanage/er/depotList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 储位列表
export const cw_ck = () => {
  return request({
    url: "/equipmentmanage/er/proOrgList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

//   逻辑删除器材出库单
export const delete_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/delete/" + params,
    method: "post",
  });
};

// 删除子表
export const delete_ckSon = (params) => {
  return request({
    url: "/equipmentmanage/er/deleteRetrievalDtl/" + params,
    method: "post",
  });
};

// 查询出库单详细信息
export const details_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/selectDetails/" + params,
    method: "post",
  });
};

// 修改出库单信息
export const updete_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/update",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};
// export const updete_ck = (params) => {
//   return request({
//     url: "/equipmentmanage/es/update",
//     method: "post",
//     data: params,
//     headers: { "Content-Type": "application/json;charset=UTF-8" },
//   });
// };

// 提交
export const submit_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/commit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 审核
export const audit_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/audit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 审核历史
export const history_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/getAuditHistory",
    method: "post",
    data: params,
  });
};

// 回退
export const undo_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/undo",
    method: "post",
    data: params,
  });
};

// 作废
export const cancel_ck = (params) => {
  return request({
    url: "/equipmentmanage/er/cancel",
    method: "post",
    data: params,
  });
};
